import { NgModule, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
// 自定义组件
import { ComponentsModule } from "../components/components.module";
// 自定义页面
import { LoginPageModule } from "../pages/login/login.module";
import { HomePageModule } from "../pages/home/home.module";
import { PersonalPageModule } from "../pages/personal/personal.module";
import { ProductOrderPageModule } from "../pages/product-order/product-order.module";
import { LineAttendancePageModule } from "../pages/line-attendance/line-attendance.module";
import { ProductStatisticsPageModule } from "../pages/product-statistics/product-statistics.module";
import { SettingsPageModule } from "../pages/settings/settings.module";
import { accountNumberSecurityPageModule } from "../pages/accountNumber-security/accountNumber-security.module";
import { ModifyPasswordPageModule } from "../pages/modify-password/modify-password.module";
import { BindingPhonePageModule } from "../pages/binding-phone/binding-phone.module";
import { AboutUsPageModule } from "../pages/about-us/about-us.module";
import { AnnualStatisticsPageModule } from "../pages/annual-statistics/annual-statistics.module";
import { QrcodeshowPageModule } from "../pages/qrcodeshow/qrcodeshow.module";
import { HttpModule } from '@angular/http';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';

// 路由模块
import { RouterModule } from '@angular/router';
import { AppRoutesModule } from './app-routing.module';
// 自定义服务
import { HttphandleProvider } from '../providers/httphandle/httphandle';
import { LocalstorageProvider } from '../providers/localstorage/localstorage';
import { Brightness } from '@ionic-native/brightness';
import { IsDebug } from '@ionic-native/is-debug';
import { Network } from '@ionic-native/network'
import { NativePageTransitions } from '@ionic-native/native-page-transitions';
import { AppUpdate } from '@ionic-native/app-update';
import { AppVersion } from '@ionic-native/app-version';
import { File } from "@ionic-native/file";
import { InAppBrowser } from '@ionic-native/in-app-browser';
import { FileOpener } from '@ionic-native/file-opener';
import { FileTransfer, FileTransferObject } from '@ionic-native/file-transfer';
import { Autostart } from '@ionic-native/autostart';
import { CodePush } from '@ionic-native/code-push';
import { ChoselinePage } from "../pages/choseline/choseline";
import { ChoselinePageModule } from '../pages/choseline/choseline.module'

@NgModule({
  declarations: [
    MyApp
  ],
  imports: [
    BrowserModule,
    HttpModule,
    RouterModule,
    AppRoutesModule,
    ComponentsModule,
    QrcodeshowPageModule,
    ChoselinePageModule,
    // 相关页面模块module
    LoginPageModule,
    HomePageModule,
    PersonalPageModule,
    ProductOrderPageModule,
    LineAttendancePageModule,
    ProductStatisticsPageModule,
    SettingsPageModule,
    accountNumberSecurityPageModule,
    ModifyPasswordPageModule,
    BindingPhonePageModule,
    AboutUsPageModule,
    AnnualStatisticsPageModule,
    IonicModule.forRoot(MyApp,{
      backButtonText: '',
      backButtonIcon: 'ios-arrow-back'
    })
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    ChoselinePage
  ],
  providers: [
    StatusBar,
    SplashScreen,
    HttphandleProvider,
    LocalstorageProvider,
    Brightness,
    IsDebug,
    Network,
    NativePageTransitions,
    AppUpdate,
    AppVersion,
    File,
    InAppBrowser,
    FileOpener,
    FileTransfer,
    FileTransferObject,
    Autostart,
    CodePush,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})
export class AppModule {}
